#ifndef __STRING_MATCH_H__
#define __STRING_MATCH_H__

/**
 * @copyright Copyright (c) 2025 
 * CSG Digital Grid Technology (Guangdong) Co., Ltd.
 * @author zhouyan
*/
#include "sys_inc.h"

enum TraceType
{
    E_NORMAL = 0,       //程序正常
    E_ACCESS = 1,       //访问文件失败
    E_LOADING,          //加载系统配置失败
    E_CREATE,           //创建设备失败
    E_DEVICE,           //设备异常
    E_MODULE,           //通讯模块异常
    E_PROGRAM,          //程序异常
    E_COMMUNICATION     //通讯异常
};

bool splitTcpDevice(const std::string &name, std::string &ip, uint32_t &port);
void stringTrim(std::string &str);
bool splitRegNames(const std::string &reg, std::string &name, int &index1, int &index2);
bool splitAttrCmdName(const std::string &name, std::string &id, std::string &str0, std::string &str1);
std::string GetTime(void);
void Print_err_log(int err_code);
void Print_err_log_msg(int err_code, const char *err_msg=nullptr);

#endif
